<?php
/**
 * Clean up the_excerpt()
 */
function roots_excerpt_more($more) {
  return ' &hellip; <a href="' . get_permalink() . '">' . __('Continued', 'roots') . '</a>';
}
add_filter('excerpt_more', 'roots_excerpt_more');

/**
 * Manage output of wp_title()
 */
function roots_wp_title($title) {
  if (is_feed()) {
    return $title;
  }

  $title .= get_bloginfo('name');

  return $title;
}
add_filter('wp_title', 'roots_wp_title', 10);

function should_display_alert($name){
    $title=get_option($name.'_title');
	if($title&&!empty($title)){
        $startTime=0;
        $endTime=0;
		$startDate=get_option($name.'_start_date');
        if($startDate){
            $startTime=strtotime($startDate);
        }
		$endDate=get_option($name.'_end_date');
        if($endDate){
            $endTime=strtotime($endDate);
        }
        $today=time();
		if(($startTime<=$today&&$endTime>=$today)||($startTime==0&&$endTime>=$today)||($startTime<=$today&&$endTime==0)){
            return true;
        }
    }
    return false;
}